<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
	body,html{
		margin: 0 auto;
		height:100%;
		width:100%;
		overflow:hidden;
	}
</style>
</head>
<body>
	<div  id="add_commodity_main" class="" style="width:100%;height:100%;">
						<div style="width:100%;height:0.7%;overflow:hidden;"></div>
						<div style="width:100%;height:98.5%;">
								<div style="width:0.4%;height:100%;float:left;overflow:hidden;"></div>
								<div style="width:99.2%;height:100%;float:left;">
									 <div style="border: 1px solid #9ABAE9;overflow: auto;height:100%;max-height:100%;">
													<!--内容区 -->
											<div style="width:100%;height:100%;">		
													 <table  id="CommodityTable" border="0"></table>
											</div>
											<div id="Commodity_tb">
											<div style="overflow: hidden; padding-left: 10px; padding-top: 5px; border-bottom: 1px solid #9ABAE9;padding-bottom: 5px;">
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-add',plain:true" onclick="window.Commodity.addCommodity()">增加货品</a>||	
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-no',plain:true" onclick="window.Commodity.addCommodity()">删除货品</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon45',plain:true" onclick="window.Commodity.addCommodity()">导出出库单</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon247',plain:true" onclick="window.Commodity.addCommodity()">打印</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon248',plain:true" onclick="window.Commodity.addCommodity()">预览</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon486',plain:true" onclick="window.User.selectUser()">查询出库单</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon705',plain:true" onclick="window.User.selectUser()">保存出库单</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon706',plain:true" onclick="window.User.selectUser()">清空</a>||
											</div>
											<div style="overflow: hidden; padding-left: 10px; padding-top: 5px; border-bottom: 1px solid #9ABAE9;padding-bottom: 5px;">
											 	<table>
											 		<tr>
											 			<td align="right">本单说明:</td>
											 			<td colspan="5"><input type="text" style="width:352px;" /></td>
											 		</tr>
											 		<tr>
											 			<td  align="right">折后应付金额:</td>
											 			<td><input type="text"></td>
											 			<td  align="right">折扣率:</td>
											 			<td><input type="text"></td>
											 			<td  align="right">实际付款:</td>
											 			<td><input type="text"></td>
											 		</tr>
											 	</table>
											</div>	
													<!--内容区 -->
									 </div>
								</div>
								<div class="width:0.37%;height:100%;float:left;overflow:hidden;"></div>
						</div>
						<div class="width:100%;height:0.6%;overflow:hidden;"></div>
	</div>
</body>
<script type="text/javascript">
(function(){	
	
	//增加货品
	function addCommodity(){
		
		if($("#Commodity_addCommodity").length>0){
			$("#Commodity_addCommodity").window("open");
		}
		$('<div id="Commodity_addCommodity"></div>').window({
		    title: '增加货品', 		
		    iconCls:'icon-add', 
		    width:getWW().w,   
		    height:getWW().h,   
		    resizable:true,
		    closed: true,   
		    draggable:false,
		    modal: true,
		    content:'aaa',
		    //content:$('<div style="width:100%;height:100%;">aaa</div>').load("${pageContext.request.contextPath}/html/pfl/system/addCommodity.jsp"),
		    onClose:function(){
				$("#Commodity_addCommodity").window("destroy",true);
				
		    }
		});
		$("#Commodity_addCommodity").window("open");
		
	}
	//创建货品table
	function createCommodityTable(){
			$('#CommodityTable').datagrid({
				fit: true,
				toolbar:"#Commodity_tb",
				singleSelect:false,
				rownumbers: true,
				animate:true,
				striped: true,
				loadMsg:'正在加载数据',
				collapsible:true,
				idField:'sysCommodity_id',
				fitColumns:true,
				columns:[[
				    {field:'sysCommodity_id',checkbox:true,width:50},	
			  		{field:'sysCommodity_name',title:'货品名称',width:120},
			  		{field:'sysCommodity_state',title:'货品状态',formatter : function(value, row, index){
						if(row.sysCommodity_state=="0"){
							return  '<font color="red">禁用</font>';
						}
						if(row.sysCommodity_state=="1"){
							return  '<font color="green">启用</font>';
						}
						return "";
						},width:120},
			  		{field:'sysCommodity_note',title:'货品描述',width:120},
			  		{field:'sysCommodity_createDate',title:'创建时间',width:120}
			  		]],
					pagination:true
				});
	}
	//注册所有事件
	window["Commodity"]={};
	window["Commodity"]["addCommodity"]=addCommodity;
	$(function(){	
		$.parser.parse('#add_commodity_main'); 
		createCommodityTable();
	});
})();
</script>
</html>